﻿using Game;
//粉碎机
namespace Mekiasm
{
    public class MekSmeltWidget : BaseEnergyWidget
    {
        public ComponentSmelt componentSmelt;

        public MekSmeltWidget(ComponentSmelt componentSmelt, ComponentMiner componentMiner) : base(componentMiner)
        {
            this.componentSmelt = componentSmelt;
            MekCraftingRecipe.FindCraftDevice(typeof(MekSmelt)).GenerateRecipeWidget(CanvasMain, componentSmelt,componentMiner, ref Tick);
            setTitle("充能冶炼炉");
        }

        public override void Update()
        {
            Tick?.Invoke();
            SetPowerProgress((float)componentSmelt.Power / (float)componentSmelt.MaxPower);
            SetLeftBottomMoreInfo($"能量消耗: {ILibrary.FormatPower(componentSmelt.InputPowerLimit)}\n能量储存:{ILibrary.FormatPower(componentSmelt.Power)}\n最大能量:{ILibrary.FormatPower(componentSmelt.MaxPower)}");
        }
    }
}
